﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GKS.DataTypes.Trees {
    /// <summary>
    /// The interface of a generic tree.
    /// </summary>
    /// <typeparam name="E">The type of elements the tree will contain</typeparam>
    public interface ITree<E> {
        /*public */int Depth { get; }

        /// <summary>
        /// A method that returns the level of the specified element.
        /// </summary>
        /// <param name="element">The element to search for.</param>
        /// <returns>The level of the specified element.</returns>
        /*public */int Level(E element);

        ///// <summary>
        ///// A method that adds a new element in the tree.
        ///// </summary>
        ///// <param name="element">The element to add to the tree.</param>
        //public void Add(E element);

        /// <summary>
        /// A method that adds an element in the tree.
        /// </summary>
        /// <param name="element">The element to add to the tree.</param>
        /// <returns>TRUE if the element was added, FALSE otherwise.</returns>
        /*public */bool Add(E element);

        /// <summary>
        /// A method that removes an element from the tree.
        /// </summary>
        /// <param name="element">The element to remove from the tree, if it exists.</param>
        /// <param name="removedElement">The element removed from the tree.</param>
        /// <returns>TRUE if the element was removed, FALSE otherwise.</returns>
        /*public */bool Remove(E element, out E removedElement);

        /// <summary>
        /// A method that removes an element from the tree.
        /// </summary>
        /// <param name="element">The element to remove from the tree.</param>
        /// <returns>TRUE if the element was removed from the tree, FALSE otherwise.</returns>
        /*public */bool Remove(E element);
    }
}
